<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
            //20~50
  function sum(num1,num2) {
      var sum1=0
      for(var i=num2;i>=num1;i--){
          sum1+=i
      }
      // return sum1
    }
  var total=sum(20,50)
  var total=sum(2,3)
  console.log(total)
  
  
  </script>
</body>
</html>